{% extends "account/base.html" %}

{% load i18n %}

{% block title %}注册账号{% endblock %}

{% block content %}
<div class="wrapper">
    <br>
    <br>
    <div class="contanier">
        <div class="contanier-fluid">
            <h3 class="alert alert-primary">注册账号</h3>
        </div>
        <div class="row justify-content-center">
            <form method="post" action=".">
                {% csrf_token %}
                <!-- 账号 -->
                <div class="form-group">
                    <label for="username">昵称</label>
                    <input type="text" class="form-control" id="username" name="username" required>
                </div>
                <!-- 邮箱 -->
                <div class="form-group">
                    <label for="email">Email</label>
                    <input type="text" class="form-control" id="email" name="email">
                </div>
                <!-- 密码 -->
                <div class="form-group">
                    <label for="password">设置密码</label>
                    <input type="password" class="form-control" id="password1" name="password1" required>
                </div>
                <!-- 确认密码 -->
                <div class="form-group">
                    <label for="password2">确认密码</label>
                    <input type="password" class="form-control" id="password2" name="password2" required>
                </div>
                <div class="form-group">
                    {% for field in form.visible_fields %}
                    {% for error in field.errors %}
                    <span>{{ field.id_for_label }}: {{error}}</span>
                    {% endfor %}
                    {% endfor %}
                </div>
<!--                {% for field in form.visible_fields %}-->
<!--                <div class="form-group">-->
<!--                    <label for="{{ field.id_for_label }}">{{ field.label }}</label>-->
<!--                    <input type="{{ field.type_for_label }}" class="form-control" id="{{ field.id_for_label }}" name="{{ field.id_for_label }}" required>-->
<!--                    {% for error in field.errors %}-->
<!--                    <span class="help-block">{{ error }}</span>-->
<!--                    {% endfor %}-->
<!--                </div>-->
<!--                {% endfor %}-->

                <!-- 提交按钮 -->
                <button type="submit" class="btn btn-primary">提交 &raquo;</button>
                <!--                {{ form.as_p }}-->
<!--                {% if redirect_field_value %}-->
<!--                <input type="hidden" name="{{ redirect_field_name }}" value="{{ redirect_field_value }}"/>-->
<!--                {% endif %}-->
                <!--                <button type="submit">提交 &raquo;</button>-->
            </form>
        </div>

        <!--        <form class="signup" id="signup_form" method="post" action="{% url 'account_signup' %}">-->
        <!--            {% csrf_token %}-->
        <!--            {{ form.as_p }}-->
        <!--            {% if redirect_field_value %}-->
        <!--            <input type="hidden" name="{{ redirect_field_name }}" value="{{ redirect_field_value }}"/>-->
        <!--            {% endif %}-->
        <!--            <button type="submit">{% trans "Sign Up" %} &raquo;</button>-->
        <!--        </form>-->
    </div>

</div>


{% endblock %}
